#!/usr/bin/env python
#-*- coding: utf8 -*-

from __init__ import *
from dbcarta import *

root = Tk()

dbcarta = dbCarta(root, project=2)
dbcarta.centerCarta('0,0')

dbcarta.loadCartaWKT([('D',"POLYGON( (-178 80,-178 70,-158 73,-158 77,-178 80),(-175 78,-175 72,-161 74,-161 76,-175 78) )",'D')])
dbcarta.loadCartaWKT([('B',"POLYGON( (-148 80,-148 70,-128 73,-142 75,-128 77,-148 80),(-145 78,-145 75.5,-138 77,-145 78),(-145 74,-145 71.5,-138 73,-145 74) )",'B')])
dbcarta.loadCartaWKT([('C',"MULTILINESTRING( (-98 80,-118 83,-118 70,-98 73),(-98 80,-101 78,-115 80,-115 73,-101 75,-98 73) )",'C')])
dbcarta.loadCartaWKT([('A',"POLYGON( (-76 80,-86 70,-78 70,-77 74,-75 74,-74 70,-66 70,-76 80),(-76 77,-77 75,-75 75,-76 77) )",'',[[-76,77]])],1)
dbcarta.loadCartaWKT([('R',"POLYGON( (-58 80,-58 70,-53 70,-53 73,-44 70,-38 70,-52 75,-38 77,-58 80),(-55 78,-55 75.5,-48 77,-55 78) )",'R')])
dbcarta.loadCartaWKT([('T',"POLYGON( (-28 80,-28 77,-20 77,-20 70,-12 70,-12 77,-4 77,-4 80,-28 80) )",'T')])
dbcarta.loadCartaWKT([('A2',"POLYGON( (14 80,4 70,12 70,13 74,15 74,16 70,24 70,14 80),(14 77,13 75,15 75,14 77) )",'A')])
#_dbcarta.loadCartaWKT([('hello',"LINESTRING(0 0,100 1,150 62)",'world')])
dbcarta.loadCartaWKT([('gg',"GEOMETRYCOLLECTION(MULTIPOINT(8 8,34 56,87 54),POLYGON( (14 80,4 70,12 70,13 74,15 74,16 70,24 70,14 80),(14 77,13 75,15 75,14 77) ),POLYGON( (-148 80,-148 70,-128 73,-142 75,-128 77,-148 80),(-145 78,-145 75.5,-138 77,-145 78),(-145 74,-145 71.5,-138 73,-145 74) ))",'A')])

dbcarta.slider.var.set(dbcarta.slider.get() + dbcarta.slider['resolution'] * 3)
dbcarta.scaleCarta()

root.mainloop()
